<?php
	require 'libraries/CreateReportLib.php';
	require 'libraries/GetClientLib.php';
	
	$samples = getAllSamples($_GET['key'],'casl','localhost','login','login');
	for($i = 0; $i < count($samples); $i++){
		if(!UpdateUnit($samples[$i]["casl_no_year"], $samples[$i]["casl_no_sample"], $_POST["unit"][$i], "casl", "localhost", "editanalysis", "editanalysis")){
			echo "fail";
		}
	}
	
	header("Location: AdministratorHomepage.php");
?>